
-- Project: SQL Attendance Data
-- Description:
	-- This is a SQL program that has data for attendance.
	-- This program is make the data more organized and make sure that the instructions follow it.
	-- It this program there will be data, which will be made into different tables.
	-- Also, different variables are used, such as Order By and other functions. 
-- Jamila Kandawala
-- Date: 12/18/2024

create database Attendance; -- This is creating a database called attendance, which will have tables in this database.

use Attendance; -- This will use the database, so everything that will happen, such as creating a table would be in this database.

-- This will create a data table called tracker, which will have many fields inside of it.
create table tracker(
	id int primary key auto_increment, -- This is an auto_increament, so it does not have value.
	firstName varchar(35), -- This is making a field for the first name, which will have up to 35 characters.
	lastName varchar(40), -- This is making a field for the last name, which will have up to 40 characters.
	classYear varchar(4), -- This is making a field for the class year, which will have up to 4 characters.
	dayOfWeek varchar(3), -- This is making a field for the day of the week, which will have up to 3 characters.
	shopAbbre varchar(2), -- This is making a field for the shop name abbreviations, which will have up to 2 characters.
	entryReason varchar(1) -- This is making a field for the entry reasons, which will have up to 1 characters.
);

create index idx_lastName on tracker(lastName); -- This will create an index for the last name, which will show mul under the key column in the table.

create index idx_shopAbbre on tracker(shopAbbre); -- This will create an index for the shop abbreiviation, which will show mul under the key column in the table.

describe tracker; -- This is describing the data table, so now values can be inserted and the columns are finalized.

-- This will insert values into the table, so that it will fill the columns in with data. 
insert into tracker 
(firstName, lastName, classYear, dayOfWeek, shopAbbre, entryReason) -- This is the order of the data, so all of it is organized and the order will match everything. 
VALUES -- This is showing that the values below will be for each person, which will consists of all the data that will be put into each field.

-- This is data for Enrique Bruno. 
('Enrique', 'Bruno', '2018', 'M', 'AT', 'A'),
('Enrique', 'Bruno', '2019', 'Tu', 'CA', 'T'),
('Enrique', 'Bruno', '2020', 'W', 'HV', 'W'),
('Enrique', 'Bruno', '2021', 'Th', 'PH', 'W'),
('Enrique', 'Bruno', '2018', 'F', 'EM', 'E'),
-- This is data for Luanna Grimaldi. 
('Luanna', 'Grimaldi', '2021', 'M', 'AT', 'A'),
('Luanna', 'Grimaldi', '2020', 'Tu', 'CR', 'T'),
('Luanna', 'Grimaldi', '2019', 'W', 'EL', 'W'),
('Luanna', 'Grimaldi', '2018', 'Th', 'IT', 'W'),
('Luanna', 'Grimaldi', '2019', 'F', 'CA', 'E'),
-- This is data for Katina Alspaugh. 
('Katina', 'Alspaugh', '2020', 'M', 'AU', 'A'),
('Katina', 'Alspaugh', '2018', 'Tu', 'AT', 'T'),
('Katina', 'Alspaugh', '2021', 'W', 'ET', 'W'),
('Katina', 'Alspaugh', '2019', 'Th', 'CA', 'W'),
('Katina', 'Alspaugh', '2020', 'F', 'MT', 'E'),
-- This is data for Anamaria Laplant. 
('Anamaria', 'Laplant', '2019', 'M', 'AU', 'A'),
('Anamaria', 'Laplant', '2018', 'Tu', 'AT', 'T'),
('Anamaria', 'Laplant', '2020', 'W', 'CR', 'W'),
('Anamaria', 'Laplant', '2021', 'Th', 'HC', 'W'),
('Anamaria', 'Laplant', '2021', 'F', 'PH', 'E'),
-- This is data for Suzi Colas. 
('Suzi', 'Colas', '2018', 'M', 'CA', 'A'),
('Suzi', 'Colas', '2019', 'Tu', 'AU', 'E'),
('Suzi', 'Colas', '2020', 'W', 'EL', 'W'),
('Suzi', 'Colas', '2021', 'Th', 'PH', 'W'),
('Suzi', 'Colas', '2021', 'F', 'EM', 'T'),
-- This is data for Teresita Halko. 
('Teresita', 'Halko', '2019', 'M', 'AT', 'T'),
('Teresita', 'Halko', '2019', 'Tu', 'CD', 'W'),
('Teresita', 'Halko', '2020', 'W', 'HV', 'W'),
('Teresita', 'Halko', '2021', 'Th', 'IT', 'A'),
('Teresita', 'Halko', '2018', 'F', 'CU', 'E'),
-- This is data for Mia Carrier. 
('Mia', 'Carrier', '2020', 'M', 'CD', 'T'),
('Mia', 'Carrier', '2019', 'Tu', 'AT', 'A'),
('Mia', 'Carrier', '2019', 'W', 'HV', 'W'),
('Mia', 'Carrier', '2018', 'Th', 'ET', 'W'),
('Mia', 'Carrier', '2021', 'F', 'AU', 'E'),
-- This is data for Vesta Chunn. 
('Vesta', 'Chunn', '2020', 'M', 'PH', 'A'),
('Vesta', 'Chunn', '2018', 'Tu', 'HC', 'T'),
('Vesta', 'Chunn', '2020', 'W', 'MT', 'W'),
('Vesta', 'Chunn', '2021', 'Th', 'EM', 'W'),
('Vesta', 'Chunn', '2019', 'F', 'CD', 'E'),
-- This is data for Floria Vanriper. 
('Floria', 'Vanriper', '2021', 'M', 'CR', 'T'),
('Floria', 'Vanriper', '2019', 'Tu', 'CA', 'A'),
('Floria', 'Vanriper', '2021', 'W', 'AT', 'W'),
('Floria', 'Vanriper', '2018', 'Th', 'MT', 'W'),
('Floria', 'Vanriper', '2020', 'F', 'HV', 'E'),
-- This is data for Maryln Kuster. 
('Maryln', 'Kuster', '2018', 'M', 'AU', 'T'),
('Maryln', 'Kuster', '2021', 'Tu', 'PH', 'A'),
('Maryln', 'Kuster', '2020', 'W', 'CD', 'W'),
('Maryln', 'Kuster', '2019', 'Th', 'CR', 'W'),
('Maryln', 'Kuster', '2018', 'F', 'EM', 'E'),
-- This is data for Kathryn Banach. 
('Kathryn', 'Banach', '2020', 'M', 'CU', 'W'),
('Kathryn', 'Banach', '2019', 'Tu', 'EL', 'T'),
('Kathryn', 'Banach', '2021', 'W', 'AU', 'A'),
('Kathryn', 'Banach', '2018', 'Th', 'CA', 'W'),
('Kathryn', 'Banach', '2021', 'F', 'ET', 'E'),
-- This is data for Lavada Baver. 
('Lavada', 'Baver', '2021', 'M', 'PH', 'W'),
('Lavada', 'Baver', '2018', 'Tu', 'EM', 'T'),
('Lavada', 'Baver', '2019', 'W', 'HV', 'A'),
('Lavada', 'Baver', '2020', 'Th', 'CU', 'W'),
('Lavada', 'Baver', '2020', 'F', 'AT', 'E'),
-- This is data for Stacey Coll. 
('Stacey', 'Coll', '2021', 'M', 'IT', 'W'),
('Stacey', 'Coll', '2020', 'Tu', 'EL', 'T'),
('Stacey', 'Coll', '2018', 'W', 'AT', 'A'),
('Stacey', 'Coll', '2018', 'Th', 'CR', 'W'),
('Stacey', 'Coll', '2019', 'F', 'CU', 'E'),
-- This is data for Rosita Ohalloron. 
('Rosita', 'Ohalloran', '2018', 'M', 'CA', 'W'),
('Rosita', 'Ohalloran', '2020', 'Tu', 'HV', 'T'),
('Rosita', 'Ohalloran', '2021', 'W', 'PH', 'E'),
('Rosita', 'Ohalloran', '2019', 'Th', 'MT', 'W'),
('Rosita', 'Ohalloran', '2018', 'F', 'EL', 'A'),
-- This is data for Tamisha Talcott. 
('Tamisha', 'Talcott', '2019', 'M', 'IT', 'W'),
('Tamisha', 'Talcott', '2021', 'Tu', 'EM', 'T'),
('Tamisha', 'Talcott', '2021', 'W', 'AU', 'A'),
('Tamisha', 'Talcott', '2018', 'Th', 'ET', 'W'),
('Tamisha', 'Talcott', '2020', 'F', 'CU', 'E'),
-- This is data for Elba Carver. 
('Elba', 'Carver', '2021', 'M', 'CR', 'W'),
('Elba', 'Carver', '2018', 'Tu', 'HC', 'E'),
('Elba', 'Carver', '2018', 'W', 'HV', 'W'),
('Elba', 'Carver', '2019', 'Th', 'AU', 'A'),
('Elba', 'Carver', '2020', 'F', 'CD', 'T'),
-- This is data for Ronda Jetter. 
('Ronda', 'Jetter', '2019', 'M', 'EL', 'W'),
('Ronda', 'Jetter', '2019', 'Tu', 'ET', 'T'),
('Ronda', 'Jetter', '2018', 'W', 'IT', 'W'),
('Ronda', 'Jetter', '2020', 'Th', 'MT', 'A'),
('Ronda', 'Jetter', '2021', 'F', 'CU', 'E'),
-- This is data for Ardelia Italiano. 
('Ardelia', 'Italiano', '2019', 'M', 'CU', 'W'),
('Ardelia', 'Italiano', '2020', 'Tu', 'EL', 'T'),
('Ardelia', 'Italiano', '2020', 'W', 'AT', 'W'),
('Ardelia', 'Italiano', '2021', 'Th', 'IT', 'A'),
('Ardelia', 'Italiano', '2018', 'F', 'ET', 'E'),
-- This is data for Kelley Wortham. 
('Kelley', 'Wortham', '2020', 'M', 'CD', 'W'),
('Kelley', 'Wortham', '2021', 'Tu', 'ET', 'E'),
('Kelley', 'Wortham', '2018', 'W', 'PH', 'W'),
('Kelley', 'Wortham', '2020', 'Th', 'IT', 'A'),
('Kelley', 'Wortham', '2019', 'F', 'CR', 'T'),
-- This is data for Sueann Malatesta. 
('Sueann', 'Malatesta', '2018', 'M', 'EL', 'W'),
('Sueann', 'Malatesta', '2021', 'Tu', 'AU', 'T'),
('Sueann', 'Malatesta', '2019', 'W', 'HC', 'W'),
('Sueann', 'Malatesta', '2020', 'Th', 'HV', 'A'),
('Sueann', 'Malatesta', '2020', 'F', 'ET', 'E'),
-- This is data for Marissa Mccants. 
('Marissa', 'Mccants', '2018', 'M', 'CA', 'E'),
('Marissa', 'Mccants', '2019', 'Tu', 'IT', 'T'),
('Marissa', 'Mccants', '2020', 'W', 'MT', 'W'),
('Marissa', 'Mccants', '2021', 'Th', 'CD', 'W'),
('Marissa', 'Mccants', '2018', 'F', 'PH', 'A'),
-- This is data for Pei Wrinkle. 
('Pei', 'Wrinkle', '2020', 'M', 'EL', 'E'),
('Pei', 'Wrinkle', '2019', 'Tu', 'AT', 'T'),
('Pei', 'Wrinkle', '2018', 'W', 'PH', 'W'),
('Pei', 'Wrinkle', '2021', 'Th', 'MT', 'A'),
('Pei', 'Wrinkle', '2020', 'F', 'CU', 'W'),
-- This is data for Frida Furlong. 
('Frida', 'Furlong', '2021', 'M', 'ET', 'E'),
('Frida', 'Furlong', '2018', 'Tu', 'IT', 'T'),
('Frida', 'Furlong', '2019', 'W', 'CA', 'W'),
('Frida', 'Furlong', '2021', 'Th', 'CD', 'W'),
('Frida', 'Furlong', '2020', 'F', 'HC', 'A'),
-- This is data for Adalberto Ebel. 
('Adalberto', 'Ebel', '2019', 'M', 'HC', 'E'),
('Adalberto', 'Ebel', '2018', 'Tu', 'PH', 'T'),
('Adalberto', 'Ebel', '2020', 'W', 'CA', 'W'),
('Adalberto', 'Ebel', '2021', 'Th', 'EL', 'W'),
('Adalberto', 'Ebel', '2019', 'F', 'CR', 'A'),
-- This is data for Charmain Rigney. 
('Charmain', 'Rigney', '2018', 'M', 'CD', 'T'),
('Charmain', 'Rigney', '2021', 'Tu', 'ET', 'E'),
('Charmain', 'Rigney', '2020', 'W', 'AU', 'W'),
('Charmain', 'Rigney', '2019', 'Th', 'EL', 'W'),
('Charmain', 'Rigney', '2018', 'F', 'MT', 'A'),
-- This is data for Sage Romberger. 
('Sage', 'Romberger', '2019', 'M', 'PH', 'A'),
('Sage', 'Romberger', '2020', 'Tu', 'HV', 'T'),
('Sage', 'Romberger', '2021', 'W', 'EL', 'W'),
('Sage', 'Romberger', '2018', 'Th', 'MT', 'W'),
('Sage', 'Romberger', '2020', 'F', 'CA', 'E'),
-- This is data for Laverna Aguas. 
('Laverna', 'Aguas', '2018', 'M', 'AU', 'T'),
('Laverna', 'Aguas', '2020', 'Tu', 'EL', 'E'),
('Laverna', 'Aguas', '2021', 'W', 'EM', 'W'),
('Laverna', 'Aguas', '2019', 'Th', 'HV', 'W'),
('Laverna', 'Aguas', '2019', 'F', 'AT', 'A'),
-- This is data for Casie Blauvelt. 
('Casie', 'Blauvelt', '2018', 'M', 'EL', 'W'),
('Casie', 'Blauvelt', '2021', 'Tu', 'PH', 'T'),
('Casie', 'Blauvelt', '2019', 'W', 'CR', 'A'),
('Casie', 'Blauvelt', '2019', 'Th', 'ET', 'W'),
('Casie', 'Blauvelt', '2020', 'F', 'HV', 'E'),
-- This is data for Hannah Villagomez. 
('Hannah', 'Villagomez', '2021', 'M', 'CA', 'W'),
('Hannah', 'Villagomez', '2018', 'Tu', 'HC', 'E'),
('Hannah', 'Villagomez', '2020', 'W', 'CR', 'W'),
('Hannah', 'Villagomez', '2021', 'Th', 'EM', 'A'),
('Hannah', 'Villagomez', '2019', 'F', 'IT', 'T'),
-- This is data for Daniel Pinon. 
('Daniel', 'Pinon', '2020', 'M', 'MT', 'E'),
('Daniel', 'Pinon', '2018', 'Tu', 'CA', 'T'),
('Daniel', 'Pinon', '2019', 'W', 'EL', 'W'),
('Daniel', 'Pinon', '2020', 'Th', 'PH', 'W'),
('Daniel', 'Pinon', '2021', 'F', 'AU', 'A')
;

-- This will select the data of the first name, last name, and the shop abbreiviation to make the name of the table called Attendance List. 
Select Concat(firstName, ' ', lastName, ' ', shopAbbre) AS 'Attendance List'
From tracker -- This is showing that all the data is from the tracker table.
Group By firstName, lastName, shopAbbre -- This will group each of the columns, so that it would not duplicate as all the data is similar.
Order By shopAbbre ASC; -- This will order the shop abbreiviation to be ascending. 


-- This will select everything and count it, it will also name the table Attendance Count.
Select Count(*) AS 'Attendance Count'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'A' AND dayOfWeek = 'M'; -- This is showing that if the entry reason is absent and the day of the week is Monday, then it will count it. 

-- This will select everything and count it, it will also name the table Attendance Count.
Select Count(*) AS 'Attendance Count'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'A' AND dayOfWeek = 'Tu'; -- This is showing that if the entry reason is absent and the day of the week is Tuesday, then it will count it. 

-- This will select everything and count it, it will also name the table Attendance Count.
Select Count(*) AS 'Attendance Count'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'A' AND dayOfWeek = 'W'; -- This is showing that if the entry reason is absent and the day of the week is Wednesday, then it will count it. 

-- This will select everything and count it, it will also name the table Attendance Count.
Select Count(*) AS 'Attendance Count'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'A' AND dayOfWeek = 'Th'; -- This is showing that if the entry reason is absent and the day of the week is Thrusday, then it will count it. 

-- This will select everything and count it, it will also name the table Attendance Count.
Select Count(*) AS 'Attendance Count'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'A' AND dayOfWeek = 'F'; -- This is showing that if the entry reason is absent and the day of the week is Friday, then it will count it. 


-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list. 
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="AT" -- This is showing that it will only be displayed if the entry reason is WBL and the AT shop.
Group By firstName, lastName, shopAbbre, classYear; -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="AU" -- This is showing that it will only be displayed if the entry reason is WBL and the AU shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="CA"  -- This is showing that it will only be displayed if the entry reason is WBL and the CA shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="CD"  -- This is showing that it will only be displayed if the entry reason is WBL and the CD shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="CR"  -- This is showing that it will only be displayed if the entry reason is WBL and the CR shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="CU"  -- This is showing that it will only be displayed if the entry reason is WBL and the CU shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="EL"  -- This is showing that it will only be displayed if the entry reason is WBL and the EL shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="EM"  -- This is showing that it will only be displayed if the entry reason is WBL and the EM shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="ET"  -- This is showing that it will only be displayed if the entry reason is WBL and the ET shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="HC"  -- This is showing that it will only be displayed if the entry reason is WBL and the HC shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="HV"  -- This is showing that it will only be displayed if the entry reason is WBL and the HV shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="IT"  -- This is showing that it will only be displayed if the entry reason is WBL and the IT shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="MT"  -- This is showing that it will only be displayed if the entry reason is WBL and the MT shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 

-- This would select and concat the following columns: first name, last name, shop abbreiviation, and class year, and the name of the table would be WBL list.
Select Concat(firstName, ' ', lastName, ' ', shopAbbre, ' ', classYear) AS 'WBL List'
From tracker -- This is showing that all the data is from the tracker table.
Where entryReason = 'W' AND shopAbbre="PH"  -- This is showing that it will only be displayed if the entry reason is WBL and the PH shop.
Group By firstName, lastName, shopAbbre, classYear;  -- This will group up the data and make all the data line up, so that it will not duplicate. 


-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'AT' -- This will make the shop abbreiviation be AT and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName; -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'AU'  -- This will make the shop abbreiviation be AU and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'CA'  -- This will make the shop abbreiviation be CA and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'CD'  -- This will make the shop abbreiviation be CD and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'CR'  -- This will make the shop abbreiviation be CR and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'CU'  -- This will make the shop abbreiviation be CU and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'EL'  -- This will make the shop abbreiviation be EL and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'EM'  -- This will make the shop abbreiviation be EM and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'ET'  -- This will make the shop abbreiviation be ET and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'HC'  -- This will make the shop abbreiviation be HC and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 
 
-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'HV'  -- This will make the shop abbreiviation be HV and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'IT'  -- This will make the shop abbreiviation be IT and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'MT'  -- This will make the shop abbreiviation be MT and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 

-- This is selecting all the columns for the data, such as the lastname, firstname, shop abbreiviation, and the class year.
Select lastName, firstName, shopAbbre, classYear
From tracker -- This is showing that all the data is from the tracker table.
Where shopAbbre = 'PH'  -- This will make the shop abbreiviation be PH and only allow this one. 
Group By lastName, firstName, shopAbbre, classYear -- This is grouping the columns and the data, so that there would be no duplicates when the data is displayed. 
Order By lastName;  -- This would order all the data that is displayed to be by lastname in an order. 


-- This will select all the information of the first name, last name, and class year, which would also make the name of the table be student data. 
Select Concat(firstName, ' ', lastName, ' ', classYear) AS 'Student Data'
From tracker -- This is showing that all the data is from the tracker table.
Where dayOfWeek = 'Tu' AND entryReason = 'E' -- This is showing how the day of the week would be tuesday and the entry reason would be early dismissal, so these both have to be true. 
Group By firstName, lastName, classYear; -- This would group all the columns of the data, which is first name, last name, and the class year. 

drop database Attendance -- This is showing that it would delete the database attendance, so the table with the data would be deleted too. 